package com.typeinfo.pets;

import java.util.ArrayList;
import java.util.List;

import javassist.Loader;

public class ForNameCreator extends PetCreator {
    private static List<Class<? extends Pet>> types=new ArrayList<Class<? extends Pet>>();
    private static String[] typeNames={"com.typeinfo.pets.Mutt","com.typeinfo.pets.Pug","com.typeinfo.pets.EgyptianMau","com.typeinfo.pets.Cymric","com.typeinfo.pets.Rat"};
    @SuppressWarnings("unchecked")
	public static void loader(){
    	for(String name:typeNames){
    		try {
				types.add((Class<? extends Pet>) Class.forName(name));
			} catch (ClassNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
    	}
    }
    static{
       loader();
    }
	public List<Class<? extends Pet>> types() {
		// TODO Auto-generated method stub
		return types;
	}

}
